package particleField;

import SimpleOpenNI.SimpleOpenNI;

import processing.core.PApplet;
import processing.core.PImage;
import processing.core.PVector;

public class ToPoint01neu extends PApplet{

	private static final long serialVersionUID = 2367740102182671291L;
	ParticleSystem ps;
	int width = 1280;
	int height = 960;
	SimpleOpenNI context;

	public void setup() {
		size(width, height, OPENGL);
		context = new SimpleOpenNI(this);
		context.setMirror(true);

		context.enableDepth();
		context.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL);

		ps = new ParticleSystem(1, new PVector(width,height), this, context);
		ps.force_disable_home();

		ellipse(mouseX, mouseY, 15, 15);
		background(0xFF000000);
		ps.loadDirectionPic(this);
	}

	public void draw() {
		context.update();
		background(0x00000000);
	
		if(mousePressed){
			ps.gravity();
		}
		
		if(this.frameCount % 30 == 0){
			System.out.println(this.frameRate);			
		}
		ps.run(this);


	}
	
	
}
